//
//  FFMediaPlayer.h
//  FFMovieFoundation
//
//  Created by xb on 4/30/14.
//  Copyright (c) 2014 xb. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "FFMediaPlayerDelegate.h"
#import "FFCommonDefines.h"

/** The Faster&Faster Player main class that provide all control about play medias.
 */
@interface FFMediaPlayer : NSObject

#pragma mark - Instance

@property (nonatomic, assign, readwrite)    BOOL shouldPlayInBackground;

#pragma datasource manager

- (void)setVodSource:(NSString *)mediaURL
               value:(NSDictionary*)value
        withDelegate:(id<FFMediaPlayerDelegate>)delegate;

- (void)setDataStream:(id<FFMediaStreamRef>)stream
                value:(NSDictionary*)value
         withDelegate:(id<FFMediaPlayerDelegate>)delegate;

- (void)setLiveSource:(NSString *)mediaURL
                value:(NSDictionary*)value
         withDelegate:(id<FFMediaPlayerDelegate>)delegate;

#pragma mark Player View
- (BOOL)setupPlayerBackgroundImage:(UIImage*)image;

- (void)setupPlayerBackgroundImage;

- (BOOL)setupPlayerWithContainerView:(UIView *)container;

- (BOOL)setupPlayerWithContainerView:(UIView *)container andBackgroundImage:(UIImage*)defaultImage;

- (BOOL)unSetupPlayer;

#pragma mark Player Control

- (void)prepareAsync;

- (void)start;

- (void)pause;

- (BOOL)isPlaying;

- (void)reset;

- (int64_t)getDuration;

- (int64_t)getCurrentPosition;

- (void)seekTo:(int)msec;

#pragma mark Video Control

- (int)getVideoWidth;

- (int)getVideoHeight;

- (float)getVideoAspectRatio;

#pragma mark Audio Control

- (float)getVolume;

- (void)setVolume:(float)volume;

- (NSArray *)getAudioTracksArray;

- (BOOL)setAudioTrackWithArrayIndex:(int)index;

#pragma mark Player View Control

- (void)setVideoScalingMode:(emFFVideoScalingMode)fillMode animate:(BOOL)animate;

- (emFFVideoScalingMode)getVideoScalingMode;

- (void)setVideoScale:(float)scale;

- (float)getVideoScale;

@end
